FC = /home/dell/install/mpich3-gf/bin/mpif90
HDF5_DIR = /home/dell/install/hdf5-gf-pl
INC = -I$(HDF5_DIR)/include
LIB = -L$(HDF5_DIR)/lib -lhdf5_fortran -lhdf5
SOURCES_DIR = ../src

CFLAGS = -O3

SOURCES = Setup.F90 Input.F90 Initialization.F90 Communication.F90 \
	  Injector.F90 Boundary.F90 Physics.F90 Output.F90 Main.F90
	      
OBJECTS = $(SOURCES:.F90=.o)

all: $(OBJECTS)
	$(FC) -o ../bin/hybrid2d $(CFLAGS) $(OBJECTS) $(LIB) -w -g -Wall -fallow-argument-mismatch
	@ echo "Hybrid2D has been complied successfully!"

$(OBJECTS):$(addprefix ../src/,$(SOURCES))
	$(FC) -c $(CFLAGS) $(INC) $(addprefix ../src/,$(SOURCES)) $< -w -g -Wall -fallow-argument-mismatch

clean:
	rm -rf *.o *.mod ../bin/hybrid2d
